<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:70:"C:\wamp\www\LOLforum\public/../application/admin\view\admin\index.html";i:1488020792;s:69:"C:\wamp\www\LOLforum\public/../application/admin\view\common\top.html";i:1487068597;s:70:"C:\wamp\www\LOLforum\public/../application/admin\view\common\left.html";i:1487857718;}*/ ?>
<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <title><?php echo $title; ?></title>	
	    <meta name="description" content="Dashboard">
	    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	    <!--Basic Styles-->
	    <link href="__ASTYLE__/bootstrap.css" rel="stylesheet">
	    <link href="__ASTYLE__/font-awesome.css" rel="stylesheet">
	    <link href="__ASTYLE__/weather-icons.css" rel="stylesheet">	
	    <!--Beyond styles-->
	    <link id="beyond-link" href="__ASTYLE__/beyond.css" rel="stylesheet" type="text/css">
	    <link href="__ASTYLE__/demo.css" rel="stylesheet">
	    <link href="__ASTYLE__/picons.css" rel="stylesheet">
	    <link href="__ASTYLE__/animate.css" rel="stylesheet">	    
	</head>
	<body>
		<!-- 头部 -->
		<div class="navbar">
    <div class="navbar-inner">
        <div class="navbar-container">
            <!-- Navbar Barnd -->
            <div class="navbar-header pull-left">
                <a href="<?php echo url('index/index'); ?>" class="navbar-brand">
                    <small><img src="__AIMG__/logo.jpg" alt=""></small>
                </a>
            </div>
            <!-- /Navbar Barnd -->
            <!-- Sidebar Collapse -->
            <div class="sidebar-collapse" id="sidebar-collapse">
                <i class="collapse-icon fa fa-bars"></i>
            </div>
            <!-- /Sidebar Collapse -->
            <!-- Account Area and Settings -->
            <div class="navbar-header pull-right">
                <div class="navbar-account">
                    <ul class="account-area">
                        <li>
                            <a class="login-area dropdown-toggle" data-toggle="dropdown">
                                <div class="avatar" title="操作">
                                    <img src="__AIMG__/adam-jansen.jpg">
                                </div>
                                <section>
                                    <h2><span class="profile"><span><?php echo \think\Request::instance()->session('adminname'); ?></span></span></h2>
                                </section>
                            </a>
                            <!--Login Area Dropdown-->
                            <ul class="pull-right dropdown-menu dropdown-arrow dropdown-login-area">
                                <li class="username"><a></a></li>
                                <li class="dropdown-footer">
                                    <a href="<?php echo url('admin/logout'); ?>">退出登录</a>
                                </li>
                                <li class="dropdown-footer">
                                    <a href="<?php echo url('admin/edit',array('id'=>\think\Request::instance()->session('id'))); ?>">修改密码</a>
                                </li>
                            </ul>
                            <!--/Login Area Dropdown-->
                        </li>
                        <!-- /Account Area -->
                        <!--Note: notice that setting div must start right after account area list.
                            no space must be between these elements-->
                        <!-- Settings -->
                    </ul>
                </div>
            </div>
            <!-- /Account Area and Settings -->
        </div>
    </div>
</div>
		<!-- /头部 -->
		
		<div class="main-container container-fluid">
			<div class="page-container">
				<!-- Page Sidebar -->
	            <div class="page-sidebar" id="sidebar">
                <!-- Page Sidebar Header-->
                <div class="sidebar-header-wrapper">
                    <input class="searchinput" type="text">
                    <i class="searchicon fa fa-search"></i>
                    <div class="searchhelper"></div>
                </div>
                <!-- /Page Sidebar Header -->
                <!-- Sidebar Menu -->
                <ul class="nav sidebar-menu">
                    <!--Dashboard-->
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon fa fa-user"></i>
                            <span class="menu-text">管理员 </span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('admin/index'); ?>">
                                    <span class="menu-text">管理列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('admingroup/index'); ?>">
                                    <span class="menu-text">用户组列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('adminrule/index'); ?>">
                                    <span class="menu-text">权限列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li> 

                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon fa fa-list"></i>
                            <span class="menu-text">会员管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('user/index'); ?>">
                                    <span class="menu-text">会员列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                             <li>
                                <a href="<?php echo url('usergroup/index'); ?>">
                                    <span class="menu-text">会员组列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('userrule/index'); ?>">
                                    <span class="menu-text">权限列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('signin/index'); ?>">
                                    <span class="menu-text">签到列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo url('integral/index'); ?>">
                                    <span class="menu-text">积分列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li> 

                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon fa fa-file-text"></i>
                            <span class="menu-text">帖子管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('note/index'); ?>">
                                    <span class="menu-text">帖子列表 </span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li> 
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon glyphicon glyphicon-comment"></i>
                            <span class="menu-text">评论管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('talk/index'); ?>">
                                    <span class="menu-text">评论列表 </span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>

                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon fa fa-link"></i>
                            <span class="menu-text">友情链接</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('link/index'); ?>">
                                    <span class="menu-text">链接列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li> 
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon glyphicon glyphicon-link"></i>
                            <span class="menu-text">广告管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('advert/index'); ?>">
                                    <span class="menu-text">广告列表 </span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon glyphicon glyphicon-list-alt"></i>
                            <span class="menu-text">新闻管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('news/index'); ?>">
                                    <span class="menu-text">新闻列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon glyphicon glyphicon-film"></i>
                            <span class="menu-text">视频管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('video/index'); ?>">
                                    <span class="menu-text">视频列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>
                     <li>
                            <a href="#" class="menu-dropdown">
                                <i class="menu-icon glyphicon glyphicon-list"></i>
                                <span class="menu-text">主题管理</span>
                                <i class="menu-expand"></i>
                            </a>
                            <ul class="submenu">
                                <li>
                                    <a href="<?php echo url('cate/index'); ?>">
                                        <span class="menu-text">主题列表 </span>
                                        <i class="menu-expand"></i>
                                    </a>
                                </li>
                            </ul>                            
                        </li>
                    <li>
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon glyphicon glyphicon-calendar"></i>
                            <span class="menu-text">商品管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('goods/index'); ?>">
                                    <span class="menu-text">商品列表 </span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon glyphicon glyphicon-bullhorn"></i>
                            <span class="menu-text">公告管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('pub/index'); ?>">
                                    <span class="menu-text">公告列表 </span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>
                    <li>
                        <a href="#" class="menu-dropdown">
                            <i class="menu-icon fa fa-gear"></i>
                            <span class="menu-text">统计管理</span>
                            <i class="menu-expand"></i>
                        </a>
                        <ul class="submenu">
                            <li>
                                <a href="<?php echo url('count/index'); ?>">
                                    <span class="menu-text">统计列表</span>
                                    <i class="menu-expand"></i>
                                </a>
                            </li>
                        </ul>                            
                    </li>                        
                    
                                           
                    
                </ul>
                <!-- /Sidebar Menu -->
            </div>
	            <!-- /Page Sidebar -->
	            <!-- Page Content -->
	            <div class="page-content">
	                <!-- Page Breadcrumb -->
	                <div class="page-breadcrumbs">
	                    <ul class="breadcrumb">
	                        <li>
	                            <a href="<?php echo url('index/index'); ?>">论坛系统</a>
	                        </li>
	                        <li class="active">用户管理</li>
	                    </ul>
	                </div>
	                <!-- /Page Breadcrumb -->	
	                <!-- Page Body -->
	                <div class="page-body">	                    
						<button type="button" tooltip="添加管理员" class="btn btn-sm btn-azure btn-addon" onclick="window.location.href = '<?php echo url('admin/add'); ?>'"> <i class="fa fa-plus"></i> Add
						</button>
						<div class="row">
						    <div class="col-lg-12 col-sm-12 col-xs-12">
						        <div class="widget">
						            <div class="widget-body">
						                <div class="flip-scroll">
						                    <table class="table table-bordered table-hover">
						                        <thead class="">
						                            <tr>
						                                <th class="text-center" width="5%">ID</th>
						                                <th class="text-center" >管理员名称</th>
						                                <th class="text-center" >所属用户组</th>
						                                <th class="text-center" width="20%">操作</th>
						                            </tr>
						                        </thead>
						                        <tbody id="popup-submit">
						                            <?php if(is_array($adminres) || $adminres instanceof \think\Collection): $i = 0; $__LIST__ = $adminres;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
						                            <tr>
						                                <td align="center"><?php echo $vo['id']; ?></td>
						                                <td align="center"><?php echo $vo['adminname']; ?></td>
						                                <td align="center"><?php echo $vo['groupTitle']; ?></td>
						                                <td align="center">
						                                	<?php if($vo['groupId'] != 1): ?>
						                                    <a href="<?php echo url('admin/edit',array('id'=>$vo['id'])); ?>" class="btn btn-primary btn-sm shiny">
						                                        <i class="fa fa-edit"></i> 编辑
						                                    </a>
						                                    <?php endif; if($vo['groupId'] != 1): ?>
						                                    <button class="btn btn-danger btn-sm shiny" val="<?php echo $vo['id']; ?>">
						                                        <i class="fa fa-edit"></i> 删除
						                                    </button>
						                                    <?php endif; ?>

						                                </td>
						                            </tr>
						                            <?php endforeach; endif; else: echo "" ;endif; ?>
						                            <tr>
						                            	<div id="b"></div>
						                            </tr>
						                        </tbody>
						                    </table>
						                </div>
						                <div style="text-align:right; margin-top:10px;"><?php echo $adminres->render(); ?></div>
						            </div>
						        </div>

						    </div>
						</div>
	
	                </div>
	                <!-- /Page Body -->
	            </div>
	            <!-- /Page Content -->
			</div>	
		</div>
	
		<!--引入外部文件-->
	    <script src="__ASTYLE__/jquery_002.js"></script>	    
	    <script src="__ASTYLE__/jquery.js"></script>
	    <script src="__ASTYLE__/bootstrap.js"></script>
	    <script src="__ASTYLE__/beyond.js"></script>
	    <!-- 极验验证引入 -->
        <script src="http://code.jquery.com/jquery-1.12.3.min.js"></script>
        <script src="http://static.geetest.com/static/tools/gt.js"></script>
        <script type="text/javascript">
        	$.ajax({
                  // 获取id，challenge，success（是否启用failback）
                  url: "<?php echo url('admin/yzm'); ?>?t=" + (new Date()).getTime(), // 加随机数防止缓存
                  type: "get",
                  dataType: "json",
                  success: function (data) {
                  	//console.log(data);
                    // window.location.href="<?php echo url('pub/yzm'); ?>";
                    // 使用initGeetest接口
                    // 参数1：配置参数
                    // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
                    initGeetest({
                      gt: data.gt,
                      challenge: data.challenge,
                      product: "popup", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
                      offline: !data.success // 表示用户后台检测极验服务器是否宕机，与SDK配合，用户一般不需要关注
                    }, handlerPopup);
                  }
                });
            // 代码详细说明
            var handlerPopup = function (captchaObj) {
           		var a = $('#popup-submit').find('button');
           		//console.log($('#popup-submit'));
            	$.each(a, function() {
            		 $(this).click(function(event) {
            		 	// 先校验是否点击了验证码
                    	var validate = captchaObj.getValidate();
                    	// console.log($(this).attr("val"));
                    	$.ajax({
		                      url: "<?php echo url('admin/del'); ?>",
		                      type: "post",
		                      // async:false,
		                      // dataType: "json",
		                      // data:$('#uname').val(),
		                      data: {
		                        // 用户名和密码等其他数据，自己获取，不做演示
		                        id:$(this).attr("val"),
		                        // 验证码数据，这些数据不用自己获取
		                        // 这是二次验证所需的三个值
		                        // 当然，你也可以直接设置验证码单独校验，省略其他信息
		                        geetest_challenge: validate.geetest_challenge,
		                        geetest_validate: validate.geetest_validate,
		                        geetest_seccode: validate.geetest_seccode
		                      },
		                      // 这里是正确返回处理结果的处理函数
		                      // 假设你就返回了1，2，3
		                      // 当然，正常情况是返回JSON数据
		                      success: function (result) {
		                        console.log('yes');
		                        // alert(result);
		                        // 1表示验证码验证失败
		                        if (result == "2") {
		                        	alert('删除失败');
		                        } else {
		                        	alert('删除成功');
		                        	window.location.reload(); 
		                        }
		                      }
		                    });
		                    // alert('请稍后');
		                    // setTimeout(function(){}, 500);
    });
            		 captchaObj.bindOn(this);
            	});
             			// 弹出式需要绑定触发验证码弹出按钮
                        // 比如在登陆页面，这个触发按钮就是登陆按钮
                        

                        // 将验证码加到id为captcha的元素里
                        // 验证码将会在下面指定的元素中显示出来
                        captchaObj.appendTo("#b");
                        // 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
            };
        </script>
	</body>
</html>